package com.glodon.jcloud.increment.shorturl.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glodon.jcloud.increment.common.pojo.CommonValidList;
import com.glodon.jcloud.increment.shorturl.entities.ShortUrl;
import com.glodon.jcloud.increment.shorturl.param.*;

/**
 * <p>
 * Create Date: 2022/12/12
 *
 * @version: V0.0.1 -SNAPSHOT
 * @author: Terry.Li
 * @mail: lib-o@glodon.com
 */
public interface ShortUrlService extends IService<ShortUrl> {

    /**
     * 获取短链接分页.
     *
     * @param shortUrlPageParam the shortUrl page param
     * @return the page
     */
    Page<ShortUrl> page(ShortUrlPageParam shortUrlPageParam);

    /**
     * 添加短链接.
     *
     * @param shortUrlAddParam the shortUrl add param
     * @return the short url
     */
    ShortUrl add(ShortUrlAddParam shortUrlAddParam);

    /**
     * 编辑短链接.
     *
     * @param shortUrlEditParam the shortUrl edit param
     */
    void edit(ShortUrlEditParam shortUrlEditParam);

    /**
     * 获取短链接详情.
     *
     * @param id the id
     * @return the shortUrl
     */
    ShortUrl queryEntity(String id);

    /**
     * 删除短链接.
     *
     * @param shortUrlIdParamList the shortUrl id param list
     */
    void delete(CommonValidList<ShortUrlIdParam> shortUrlIdParamList);

    /**
     * 获取短链接详情.
     *
     * @param shortUrlIdParam the shortUrl id param
     * @return the shortUrl
     */
    ShortUrl detail(ShortUrlIdParam shortUrlIdParam);

    /**
     * 获取短链接跳转地址.
     *
     * @param alias the alias
     * @return the link
     */
    String getLink(String alias);

    /**
     * View.
     *
     * @param alias the alias
     */
    void view(String alias);

    /**
     * 转换文本中短链接.
     *
     * @param shortUrlConvertParam the short url convert param
     * @return the string
     */
    String convert(ShortUrlConvertParam shortUrlConvertParam);
}
